home *** CD-ROM | disk | FTP | other *** search
- package sun.plugin;
-
- import com.sun.deploy.cache.Cache;
- import com.sun.deploy.cache.DeployCacheHandler;
- import com.sun.deploy.config.Config;
- import com.sun.deploy.net.cookie.DeployCookieSelector;
- import com.sun.deploy.net.offline.DeployOfflineManager;
- import com.sun.deploy.net.proxy.DeployProxySelector;
- import com.sun.deploy.perf.DeployPerfUtil;
- import com.sun.deploy.resources.ResourceManager;
- import com.sun.deploy.security.DeployAuthenticator;
- import com.sun.deploy.services.ServiceManager;
- import com.sun.deploy.ui.UIFactory;
- import com.sun.deploy.util.ConsoleHelper;
- import com.sun.deploy.util.DeploySysRun;
- import com.sun.deploy.util.URLUtil;
- import com.sun.deploy.util.UpdateCheck;
- import com.sun.java.browser.net.ProxyService;
- import java.applet.Applet;
- import java.applet.AppletContext;
- import java.awt.Color;
- import java.awt.Component;
- import java.awt.Dimension;
- import java.awt.Frame;
- import java.awt.Graphics;
- import java.awt.event.WindowEvent;
- import java.awt.event.WindowListener;
- import java.io.File;
- import java.io.IOException;
- import java.io.InputStream;
- import java.io.ObjectInputStream;
- import java.lang.reflect.Method;
- import java.net.Authenticator;
- import java.net.MalformedURLException;
- import java.net.URL;
- import java.net.URLConnection;
- import java.text.MessageFormat;
- import java.util.ArrayList;
- import java.util.HashMap;
- import java.util.Iterator;
- import java.util.Locale;
- import java.util.Properties;
- import java.util.StringTokenizer;
- import javax.swing.ImageIcon;
- import netscape.javascript.JSException;
- import netscape.javascript.JSObject;
- import sun.applet.AppletClassLoader;
- import sun.applet.AppletPanel;
- import sun.awt.AppContext;
- import sun.net.ProgressMonitor;
- import sun.net.www.MimeTable;
- import sun.net.www.protocol.jar.URLJarFile;
- import sun.plugin.cache.JarCacheUtil;
- import sun.plugin.extension.ExtensionInstallationImpl;
- import sun.plugin.javascript.JSContext;
- import sun.plugin.net.proxy.PluginProxyServiceProvider;
- import sun.plugin.perf.PluginRollup;
- import sun.plugin.resources.ResourceHandler;
- import sun.plugin.security.ActivatorSecurityManager;
- import sun.plugin.security.JDK11ClassFileTransformer;
- import sun.plugin.security.PluginClassLoader;
- import sun.plugin.services.BrowserService;
- import sun.plugin.util.GrayBoxPainter;
- import sun.plugin.util.PluginSysUtil;
- import sun.plugin.util.Trace;
- import sun.plugin.util.UserProfile;
- import sun.plugin.viewer.context.PluginAppletContext;
-
- public class AppletViewer extends AppletPanel implements WindowListener {
- private GrayBoxPainter grayBoxPainter = new GrayBoxPainter(this);
- private GrayBoxListener grayBoxListener = null;
- private String customBoxMessage = null;
- private boolean dumpPerf = false;
- private boolean loading_first_time = true;
- private boolean preloading = false;
- private volatile boolean stopped = false;
- private static Frame dummyFrame = new Frame();
- private static boolean initialized = false;
- public static String theVersion = "1.1";
- private URL documentURL = null;
- protected URL baseURL = null;
- protected HashMap atts = new HashMap();
- private ClassLoaderInfo cli = null;
- private static boolean fShowException = false;
- public volatile boolean readyToQuit = true;
- public Object appletQuitLock = new Object();
- private AppletEventListener appletEventListener = new AppletEventListener((1)null);
- private Object syncInit = new Object();
- private boolean bInit = false;
- private static final String VERSION_TAG = "version=";
- private HashMap jarVersionMap = new HashMap();
- private HashMap preloadJarMap = new HashMap();
- private ArrayList newStyleJarList = new ArrayList();
- private static final String PRELOAD = "preload";
- private boolean docbaseInit = false;
- private Object docBaseSyncObj = new Object();
- protected boolean codeBaseInit = false;
- private String classLoaderCacheKey = null;
- private AppletStatusListener statusListener = null;
- private PluginAppletContext appletContext;
- // $FF: renamed from: is java.io.InputStream
- private InputStream field_0;
-
- public static void loadPropertiesFiles() {
- DeployPerfUtil.put("START - Java - JVM - AppletViewer.loadPropertiesFiles");
-
- try {
- File var0 = new File(UserProfile.getPropertyFile());
- var0.getParentFile().mkdirs();
- } catch (Throwable var1) {
- Trace.printException(var1);
- }
-
- DeployPerfUtil.put("END - Java - JVM - AppletViewer.loadPropertiesFiles");
- }
-
- public static void setStartTime(long var0) {
- String var2 = System.getProperty("sun.perflog");
- if (var2 != null) {
- try {
- Class var3 = Class.forName("sun.misc.PerformanceLogger");
- if (var3 != null) {
- Class[] var4 = new Class[]{String.class, Long.TYPE};
- Method var5 = var3.getMethod("setStartTime", var4);
- if (var5 != null) {
- Object[] var6 = new Object[]{"Java Plug-in load time", new Long(var0)};
- var5.invoke((Object)null, var6);
- }
- }
- } catch (Exception var7) {
- }
- }
-
- }
-
- public static void initEnvironment(int var0, long var1) {
- if (!initialized) {
- setStartTime(var1);
- initEnvironment(var0);
- }
- }
-
- public static void initEnvironment(int var0) {
- if (!initialized) {
- initialized = true;
- DeployPerfUtil.put("START - Java - ENV - AppletViewer.initEnvironment");
- DeployPerfUtil.put("START - Java - ENV - AppletViewer.initEnvironment - PluginSysUtil.getPluginThreadGroup");
- PluginSysUtil.getPluginThreadGroup();
- DeployPerfUtil.put("END - Java - ENV - AppletViewer.initEnvironment - PluginSysUtil.getPluginThreadGroup");
-
- try {
- DeployPerfUtil.put("START - Java - ENV - AppletViewer.initEnvironment - set initial proxy");
- ProxyService.setProvider(new PluginProxyServiceProvider());
- DeployPerfUtil.put("END - Java - ENV - AppletViewer.initEnvironment - set initial proxy");
- } catch (Exception var15) {
- }
-
- DeployPerfUtil.put("START - Java - ENV - AppletViewer.initEnvironment - ServiceManager.setService");
- ServiceManager.setService(var0);
- DeployPerfUtil.put("END - Java - ENV - AppletViewer.initEnvironment - ServiceManager.setService");
-
- try {
- Class var1 = ImageIcon.class;
- } catch (Throwable var14) {
- }
-
- try {
- DeployPerfUtil.put("START - Java - ENV - AppletViewer.initEnvironment - JDK11ClassFileTransformer.init");
- JDK11ClassFileTransformer.init();
- DeployPerfUtil.put("END - Java - ENV - AppletViewer.initEnvironment - JDK11ClassFileTransformer.init");
- } catch (Throwable var13) {
- var13.printStackTrace();
- }
-
- DeployPerfUtil.put("START - Java - ENV - AppletViewer.initEnvironment - load deploy.properties");
- Properties var16 = Config.getProperties();
- Properties var2 = new Properties(System.getProperties());
- var2.put("acl.read", "+");
- var2.put("acl.read.default", "");
- var2.put("acl.write", "+");
- var2.put("acl.write.default", "");
- var2.put("browser.version", theVersion);
- var2.put("browser.vendor", "Sun Microsystems, Inc.");
- var2.put("http.agent", "Mozilla/4.0 (" + System.getProperty("os.name") + " " + System.getProperty("os.version") + ")");
- var2.put("sun.net.http.errorstream.enableBuffering", "true");
- var2.put("package.restrict.access.sun", "true");
- var2.put("package.restrict.access.com.sun.deploy", "true");
- var2.put("package.restrict.access.org.mozilla.jss", "true");
- var2.put("package.restrict.access.netscape", "false");
- var2.put("package.restrict.definition.java", "true");
- var2.put("package.restrict.definition.sun", "true");
- var2.put("package.restrict.definition.netscape", "true");
- var2.put("package.restrict.definition.com.sun.deploy", "true");
- var2.put("package.restrict.definition.org.mozilla.jss", "true");
- var2.put("java.version.applet", "true");
- var2.put("java.vendor.applet", "true");
- var2.put("java.vendor.url.applet", "true");
- var2.put("java.class.version.applet", "true");
- var2.put("os.name.applet", "true");
- var2.put("os.version.applet", "true");
- var2.put("os.arch.applet", "true");
- var2.put("file.separator.applet", "true");
- var2.put("path.separator.applet", "true");
- var2.put("line.separator.applet", "true");
- String var3 = var2.getProperty("java.protocol.handler.pkgs");
- if (var3 != null) {
- var2.put("java.protocol.handler.pkgs", var3 + "|sun.plugin.net.protocol|com.sun.deploy.net.protocol");
- } else {
- var2.put("java.protocol.handler.pkgs", "sun.plugin.net.protocol|com.sun.deploy.net.protocol");
- }
-
- DeployPerfUtil.put("START - Java - ENV - AppletViewer.initEnvironment - URLConnection.setDefaultAllowUserInteraction");
- URLConnection.setDefaultAllowUserInteraction(true);
- DeployPerfUtil.put("END - Java - ENV - AppletViewer.initEnvironment - URLConnection.setDefaultAllowUserInteraction");
- if (var2.get("https.protocols") == null) {
- StringBuffer var4 = new StringBuffer();
- if (Config.getBooleanProperty("deployment.security.TLSv1")) {
- var4.append("TLSv1");
- }
-
- if (Config.getBooleanProperty("deployment.security.SSLv3")) {
- if (var4.length() != 0) {
- var4.append(",");
- }
-
- var4.append("SSLv3");
- }
-
- if (Config.getBooleanProperty("deployment.security.SSLv2Hello")) {
- if (var4.length() != 0) {
- var4.append(",");
- }
-
- var4.append("SSLv2Hello");
- }
-
- var2.put("https.protocols", var4.toString());
- }
-
- var2.put("http.auth.serializeRequests", "true");
- DeployPerfUtil.put("START - Java - ENV - AppletViewer.initEnvironment - JavaRunTime.initTraceEnvironment");
- JavaRunTime.initTraceEnvironment();
- DeployPerfUtil.put("END - Java - ENV - AppletViewer.initEnvironment - JavaRunTime.initTraceEnvironment");
- String var17 = Config.getProperty("deployment.console.startup.mode");
- DeployPerfUtil.put("START - Java - ENV - AppletViewer.initEnvironment - display JavaConsole");
- if ("SHOW".equalsIgnoreCase(var17)) {
- JavaRunTime.showJavaConsole(true);
- } else if (!"DISABLE".equalsIgnoreCase(var17)) {
- BrowserService var5 = (BrowserService)ServiceManager.getService();
- if (var5.isConsoleIconifiedOnClose()) {
- JavaRunTime.showJavaConsole(false);
- }
- }
-
- DeployPerfUtil.put("END - Java - ENV - AppletViewer.initEnvironment - display JavaConsole");
- if ("true".equalsIgnoreCase(var2.getProperty("deployment.javapi.lifecycle.exception", "false"))) {
- fShowException = true;
- }
-
- String var18 = var2.getProperty("sun.net.client.defaultConnectTimeout", "120000");
- var2.put("sun.net.client.defaultConnectTimeout", var18);
- DeployPerfUtil.put("START - Java - ENV - AppletViewer.initEnvironment - install extension package");
-
- try {
- Class var6 = Class.forName("sun.misc.ExtensionDependency");
- if (var6 != null) {
- Class[] var7 = new Class[]{Class.forName("sun.misc.ExtensionInstallationProvider")};
- Method var8 = var6.getMethod("addExtensionInstallationProvider", var7);
- if (var8 != null) {
- Object[] var9 = new Object[]{new ExtensionInstallationImpl()};
- var8.invoke((Object)null, var9);
- } else {
- Trace.msgPrintln("optpkg.install.error.nomethod");
- }
- } else {
- Trace.msgPrintln("optpkg.install.error.noclass");
- }
- } catch (Throwable var12) {
- Trace.printException(var12);
- }
-
- DeployPerfUtil.put("END - Java - ENV - AppletViewer.initEnvironment - install extension package");
- var2.remove("proxyHost");
- var2.remove("proxyPort");
- var2.remove("http.proxyHost");
- var2.remove("http.proxyPort");
- var2.remove("https.proxyHost");
- var2.remove("https.proxyPort");
- var2.remove("ftpProxyHost");
- var2.remove("ftpProxyPort");
- var2.remove("ftpProxySet");
- var2.remove("gopherProxyHost");
- var2.remove("gopherProxyPort");
- var2.remove("gopherProxySet");
- var2.remove("socksProxyHost");
- var2.remove("socksProxyPort");
- if ("true".equalsIgnoreCase(var2.getProperty("javaplugin.proxy.authentication", "true"))) {
- DeployPerfUtil.put("START - Java - ENV - AppletViewer.initEnvironment - enable proxy/web server authentication");
- Authenticator.setDefault(new DeployAuthenticator());
- DeployPerfUtil.put("END - Java - ENV - AppletViewer.initEnvironment - enable proxy/web server authentication");
- }
-
- System.setProperties(var2);
- DeployPerfUtil.put("END - Java - ENV - AppletViewer.initEnvironment - load deploy.properties");
- System.out.println("");
- DeployPerfUtil.put("START - Java - ENV - AppletViewer.initEnvironment - DeployProxySelector.reset");
- DeployProxySelector.reset();
- DeployPerfUtil.put("END - Java - ENV - AppletViewer.initEnvironment - DeployProxySelector.reset");
- DeployPerfUtil.put("START - Java - ENV - AppletViewer.initEnvironment - DeployCookieSelector.reset");
- DeployCookieSelector.reset();
- DeployPerfUtil.put("END - Java - ENV - AppletViewer.initEnvironment - DeployCookieSelector.reset");
- DeployPerfUtil.put("START - Java - ENV - AppletViewer.initEnvironment - DeployOfflineManager.reset");
- DeployOfflineManager.reset();
- DeployPerfUtil.put("END - Java - ENV - AppletViewer.initEnvironment - DeployOfflineManager.reset");
- System.out.println("");
- DeployPerfUtil.put("START - Java - ENV - AppletViewer.initEnvironment - DeployCacheHandler.reset");
- Class var19 = Cache.class;
- DeployCacheHandler.reset();
- DeployPerfUtil.put("END - Java - ENV - AppletViewer.initEnvironment - DeployCacheHandler.reset");
- System.out.println("");
-
- try {
- DeployPerfUtil.put("START - Java - ENV - AppletViewer.initEnvironment - prep MIME types table");
- MimeTable var20 = MimeTable.getDefaultTable();
- DeployPerfUtil.put("END - Java - ENV - AppletViewer.initEnvironment - prep MIME types table");
- } catch (Throwable var11) {
- Trace.printException(var11);
- }
-
- DeployPerfUtil.put("START - Java - ENV - AppletViewer.initEnvironment - ProgressMonitor.setDefault");
- ProgressMonitor.setDefault(new sun.plugin.util.ProgressMonitor());
- DeployPerfUtil.put("END - Java - ENV - AppletViewer.initEnvironment - ProgressMonitor.setDefault");
- DeployPerfUtil.put("START - Java - ENV - AppletViewer.initEnvironment - install security manager");
- ActivatorSecurityManager var21 = new ActivatorSecurityManager();
- System.setSecurityManager(var21);
- DeployPerfUtil.put("END - Java - ENV - AppletViewer.initEnvironment - install security manager");
- DeployPerfUtil.put("START - Java - ENV - AppletViewer.initEnvironment - ConsoleHelper.displayHelp");
- System.out.println(ConsoleHelper.displayHelp());
- DeployPerfUtil.put("END - Java - ENV - AppletViewer.initEnvironment - ConsoleHelper.displayHelp");
- DeployPerfUtil.put("START - Java - ENV - AppletViewer.initEnvironment - Config.validateSystemCacheDirectory");
- Config.validateSystemCacheDirectory();
- DeployPerfUtil.put("END - Java - ENV - AppletViewer.initEnvironment - Config.validateSystemCacheDirectory");
- DeployPerfUtil.put("START - Java - ENV - AppletViewer.initEnvironment - URLJarFile.setCallBack");
- URLJarFile.setCallBack(new PluginURLJarFileCallBack());
- DeployPerfUtil.put("END - Java - ENV - AppletViewer.initEnvironment - URLJarFile.setCallBack");
- if (System.getProperty("os.name").indexOf("Windows") != -1) {
- DeployPerfUtil.put("START - Java - ENV - AppletViewer.initEnvironment - show update message");
- UpdateCheck.showDialog();
- DeployPerfUtil.put("END - Java - ENV - AppletViewer.initEnvironment - show update message");
- }
-
- DeployPerfUtil.put("START - Java - ENV - AppletViewer.initEnvironment - upgrade cache");
-
- try {
- DeploySysRun.execute(new 1());
- } catch (Exception var10) {
- Trace.printException(var10);
- }
-
- DeployPerfUtil.put("END - Java - ENV - AppletViewer.initEnvironment - upgrade cache");
- DeployPerfUtil.put("END - Java - ENV - AppletViewer.initEnvironment");
- }
- }
-
- public void appletInit() {
- if (!Config.isConfigValid()) {
- UIFactory.showErrorDialog((Component)null, ResourceManager.getString("launcherrordialog.brief.message.applet"), ResourceManager.getString("enterprize.cfg.mandatory.applet", Config.getEnterprizeString()), ResourceManager.getString("error.default.title.applet"));
- } else {
- if (this.createClassLoader()) {
- this.initApplet();
- }
-
- }
- }
-
- private void initJarVersionMap() {
- int var1 = 1;
- String var2 = this.getParameter("archive_" + var1);
- if (var2 == null) {
- String var13 = this.getParameter("cache_archive");
- String var14 = this.getParameter("cache_version");
- String var15 = this.getParameter("cache_archive_ex");
-
- try {
- this.jarVersionMap = JarCacheUtil.getJarsWithVersion(var13, var14, var15);
- } catch (Exception var12) {
- Trace.printException(var12, ResourceHandler.getMessage("cache.error.text"), ResourceHandler.getMessage("cache.error.caption"));
- }
-
- if (var15 != null) {
- StringTokenizer var16 = new StringTokenizer(var15, ",", false);
-
- while(var16.hasMoreTokens()) {
- String var8 = var16.nextToken().trim();
- int var9 = var8.indexOf(59);
- if (var9 != -1) {
- String var10 = var8.substring(var9);
- if (var10.toLowerCase().indexOf("preload") != -1) {
- String var11 = var8.substring(0, var9);
- this.preloadJarMap.put(var11, (Object)null);
- }
- }
- }
- }
- } else {
- while(var2 != null) {
- StringTokenizer var4 = new StringTokenizer(var2, ",", false);
- String var5 = null;
- String var6 = null;
- boolean var7 = false;
-
- while(var4.hasMoreTokens()) {
- String var3 = var4.nextToken().trim();
- if (var5 == null) {
- var5 = var3;
- } else if (var3.toLowerCase().startsWith("version=")) {
- var6 = var3.substring("version=".length());
- } else if (var3.toLowerCase().equals("preload")) {
- var7 = true;
- }
- }
-
- if (var5 != null) {
- if (var7) {
- this.preloadJarMap.put(var5, var6);
- }
-
- this.jarVersionMap.put(var5, var6);
- this.newStyleJarList.add(var5);
- }
-
- ++var1;
- var2 = this.getParameter("archive_" + var1);
- }
- }
-
- }
-
- private void storeJarVersionMapInAppContext() {
- for(String var2 : this.jarVersionMap.keySet()) {
- String var3 = (String)this.jarVersionMap.get(var2);
- URL var4 = null;
-
- try {
- var4 = new URL(this.getCodeBase(), var2);
- } catch (MalformedURLException var6) {
- com.sun.deploy.util.Trace.ignoredException(var6);
- }
-
- if (var4 != null) {
- AppContext.getAppContext().put(Config.getAppContextKeyPrefix() + var4.toString(), var3);
- }
- }
-
- }
-
- public boolean createClassLoader() {
- DeployPerfUtil.put("START - Java - ENV - AppletViewer.createClassLoader");
- this.addAppletListener(this.appletEventListener);
- this.initJarVersionMap();
- URL var1 = this.getCodeBase();
- if (var1 == null) {
- return false;
- } else {
- try {
- if (!this.jarVersionMap.isEmpty()) {
- JarCacheUtil.verifyJarVersions(var1, this.getClassLoaderCacheKey(), this.jarVersionMap);
- }
- } catch (Exception var5) {
- Trace.printException(var5, ResourceHandler.getMessage("cache.error.text"), ResourceHandler.getMessage("cache.error.caption"));
- }
-
- this.cli = ClassLoaderInfo.find(var1, this.getClassLoaderCacheKey());
- this.cli.addReference();
- this.appletContext.addAppletPanelInContext(this);
- synchronized(AppletViewer.class) {
- super.init();
- }
-
- DeployPerfUtil.put("END - Java - ENV - AppletViewer.createClassLoader");
- return true;
- }
- }
-
- public void initApplet() {
- DeployPerfUtil.put("START - Java - ENV - AppletViewer.initApplet");
- Thread var1 = this.getAppletHandlerThread();
- if (!this.bInit) {
- String var2 = this.getParameter("image");
- if (var2 != null) {
- try {
- URL var3 = new URL(this.getCodeBase(), var2);
- this.grayBoxPainter.setCustomImageURL(var3);
- } catch (MalformedURLException var6) {
- var6.printStackTrace();
- }
- }
-
- this.grayBoxPainter.setProgressFilter(this.getCodeBase(), this.getJarFiles());
- this.grayBoxPainter.beginPainting(var1.getThreadGroup());
- this.grayBoxListener = new GrayBoxListener(this, this.customBoxMessage);
- this.addMouseListener(this.grayBoxListener);
- } else {
- this.grayBoxPainter.resumePainting();
- }
-
- Trace.msgPrintln("applet.progress.load");
- this.sendEvent(1);
- Trace.msgPrintln("applet.progress.init");
- this.sendEvent(2);
- synchronized(this.syncInit) {
- this.bInit = true;
- }
-
- DeployPerfUtil.put("END - Java - ENV - AppletViewer.initApplet");
- }
-
- public void appletStart() {
- synchronized(this.syncInit) {
- if (!this.bInit) {
- return;
- }
- }
-
- if (this.stopped) {
- this.grayBoxPainter.suspendPainting();
- this.stopped = false;
- }
-
- Trace.msgPrintln("applet.progress.start");
-
- try {
- DeployPerfUtil.write(new PluginRollup());
- Trace.println("completed perf rollup");
- this.dumpPerf = true;
- } catch (IOException var3) {
- }
-
- this.sendEvent(3);
- }
-
- public void appletStop() {
- this.stopped = true;
- synchronized(this.syncInit) {
- if (!this.bInit) {
- return;
- }
- }
-
- if (this.grayBoxPainter != null) {
- this.grayBoxPainter.suspendPainting();
- }
-
- if (this.status == 1) {
- Trace.msgPrintln("applet.progress.stoploading");
- this.stopLoading();
- }
-
- Trace.msgPrintln("applet.progress.stop");
- this.sendEvent(4);
- }
-
- public void appletDestroy() {
- this.appletDestroy(1000L);
- }
-
- public void appletDestroy(long var1) {
- this.stopped = true;
- synchronized(this.syncInit) {
- if (!this.bInit) {
- return;
- }
- }
-
- if (this.grayBoxPainter != null) {
- this.grayBoxPainter.finishPainting();
- this.grayBoxPainter = null;
- }
-
- if (this.grayBoxListener != null) {
- this.removeMouseListener(this.grayBoxListener);
- this.grayBoxListener = null;
- }
-
- this.removeAppletListener(this.appletEventListener);
- this.appletEventListener = null;
- this.appletContext.removeAppletPanelFromContext(this);
- Thread var3 = this.getAppletHandlerThread();
- Trace.msgPrintln("applet.progress.findinfo.0");
- this.cli.removeReference();
- this.cli = null;
- Trace.msgPrintln("applet.progress.findinfo.1");
- 2 var4 = new 2(this);
- Thread var5 = new Thread(var4);
- var5.start();
-
- try {
- Trace.msgPrintln("applet.progress.joining");
- if (var3 != null) {
- var3.join(var1);
- }
-
- Trace.msgPrintln("applet.progress.joined");
- } catch (InterruptedException var7) {
- }
-
- }
-
- protected void onPrivateClose(int var1) {
- Trace.msgPrintln("applet.progress.destroy");
- this.sendEvent(5);
- Trace.msgPrintln("applet.progress.dispose");
- this.sendEvent(0);
- synchronized(this.appletQuitLock) {
- while(!this.readyToQuit) {
- try {
- this.appletQuitLock.wait();
- } catch (InterruptedException var5) {
- }
- }
- }
-
- Trace.msgPrintln("applet.progress.quit");
- this.sendEvent(6);
- this.appletContext = null;
- }
-
- public void preRefresh() {
- Cache.clearLoadedResources();
- if (this.cli != null) {
- ClassLoaderInfo var10000 = this.cli;
- ClassLoaderInfo.markNotCachable(this.getCodeBase(), this.getClassLoaderCacheKey());
- }
-
- }
-
- public String getParameter(String var1) {
- var1 = var1.toLowerCase(Locale.ENGLISH);
- synchronized(this.atts) {
- String var3 = (String)this.atts.get(var1);
- if (var3 != null) {
- var3 = this.trimWhiteSpaces(var3);
- }
-
- return var3;
- }
- }
-
- public void setParameter(String var1, Object var2) {
- var1 = var1.toLowerCase(Locale.ENGLISH);
- synchronized(this.atts) {
- this.atts.put(var1, this.trimWhiteSpaces(var2.toString()));
- }
- }
-
- private String trimWhiteSpaces(String var1) {
- if (var1 == null) {
- return var1;
- } else {
- StringBuffer var2 = new StringBuffer();
-
- for(int var3 = 0; var3 < var1.length(); ++var3) {
- char var4 = var1.charAt(var3);
- if (var4 != '\n' && var4 != '\f' && var4 != '\r' && var4 != '\t') {
- var2.append(var4);
- }
- }
-
- return var2.toString().trim();
- }
- }
-
- public void setDocumentBase(String var1) {
- if (!this.docbaseInit) {
- String var2 = URLUtil.canonicalize(var1);
-
- try {
- this.documentURL = new URL(this.canonicalizeDocumentURL(var2));
- } catch (Throwable var6) {
- var6.printStackTrace();
- }
-
- this.docbaseInit = true;
- synchronized(this.docBaseSyncObj) {
- this.docBaseSyncObj.notifyAll();
- }
- }
-
- }
-
- public String canonicalizeDocumentURL(String var1) {
- int var2 = -1;
- int var4 = var1.indexOf(35);
- int var5 = var1.indexOf(63);
- if (var5 != -1 && var4 != -1) {
- var2 = Math.min(var4, var5);
- } else if (var4 != -1) {
- var2 = var4;
- } else if (var5 != -1) {
- var2 = var5;
- }
-
- String var6;
- if (var2 == -1) {
- var6 = var1;
- } else {
- var6 = var1.substring(0, var2);
- }
-
- StringBuffer var7 = new StringBuffer(var6);
- int var8 = var7.toString().indexOf("|");
- if (var8 >= 0) {
- var7.setCharAt(var8, ':');
- }
-
- if (var2 != -1) {
- var7.append(var1.substring(var2));
- }
-
- return var7.toString();
- }
-
- public URL getDocumentBase() {
- Object var1 = new Object();
- synchronized(var1) {
- if (!this.docbaseInit) {
- BrowserService var3 = (BrowserService)ServiceManager.getService();
- if (var3.isNetscape() && var3.getBrowserVersion() >= 5.0F) {
- try {
- synchronized(this.docBaseSyncObj) {
- while(!this.docbaseInit) {
- this.docBaseSyncObj.wait(0L);
- }
- }
- } catch (InterruptedException var11) {
- var11.printStackTrace();
- }
- } else {
- JSContext var4 = (JSContext)this.getAppletContext();
-
- try {
- JSObject var5 = var4.getJSObject();
- if (var5 == null) {
- throw new JSException("Unable to obtain Window object");
- }
-
- JSObject var6 = (JSObject)var5.getMember("document");
- if (var6 == null) {
- throw new JSException("Unable to obtain Document object");
- }
-
- String var7 = (String)var6.getMember("URL");
- String var8 = URLUtil.canonicalize(var7);
- this.documentURL = new URL(this.canonicalizeDocumentURL(var8));
- } catch (Throwable var12) {
- Trace.println(var12.getMessage());
- return null;
- }
-
- this.docbaseInit = true;
- }
- }
- }
-
- return this.documentURL;
- }
-
- public URL getCodeBase() {
- Object var1 = new Object();
- synchronized(var1) {
- if (!this.codeBaseInit) {
- String var3 = this.getParameter("java_codebase");
- if (var3 == null) {
- var3 = this.getParameter("codebase");
- }
-
- URL var4 = this.getDocumentBase();
- if (var4 == null) {
- return null;
- }
-
- if (var3 != null) {
- if (!var3.equals(".") && !var3.endsWith("/")) {
- var3 = var3 + "/";
- }
-
- var3 = URLUtil.canonicalize(var3);
-
- try {
- this.baseURL = new URL(var4, var3);
- } catch (MalformedURLException var10) {
- }
- }
-
- if (this.baseURL == null) {
- String var5 = var4.toString();
- int var6 = var5.indexOf(63);
- if (var6 > 0) {
- var5 = var5.substring(0, var6);
- }
-
- var6 = var5.lastIndexOf(47);
- if (var6 > -1 && var6 < var5.length() - 1) {
- try {
- this.baseURL = new URL(URLUtil.canonicalize(var5.substring(0, var6 + 1)));
- } catch (MalformedURLException var9) {
- }
- }
-
- if (this.baseURL == null) {
- this.baseURL = var4;
- }
- }
-
- this.codeBaseInit = true;
- }
- }
-
- return this.baseURL;
- }
-
- public int getWidth() {
- String var1 = this.getParameter("width");
- return var1 != null ? Integer.valueOf(var1) : 0;
- }
-
- public int getHeight() {
- String var1 = this.getParameter("height");
- return var1 != null ? Integer.valueOf(var1) : 0;
- }
-
- public boolean hasInitialFocus() {
- if (!this.isJDK11Applet() && !this.isJDK12Applet()) {
- String var1 = this.getParameter("initial_focus");
- if (var1 != null && var1.toLowerCase().equals("false")) {
- return false;
- } else {
- return !Config.getInstance().isNativeModalDialogUp();
- }
- } else {
- return false;
- }
- }
-
- public String getCode() {
- String var1 = this.getParameter("classid");
- Object var2 = null;
- if (var1 != null) {
- int var3 = var1.indexOf("java:");
- if (var3 > -1) {
- String var4 = var1.substring(5 + var3);
- if (var4 != null || !var4.equals("")) {
- return var4;
- }
- }
- }
-
- String var5 = this.getParameter("java_code");
- if (var5 == null) {
- var5 = this.getParameter("code");
- }
-
- return var5;
- }
-
- public boolean isLegacyLifeCycle() {
- String var1 = this.getParameter("legacy_lifecycle");
- return var1 != null && var1.equalsIgnoreCase("true");
- }
-
- public String getClassLoaderCacheKey() {
- String var1 = this.getParameter("classloader-policy");
- if (var1 != null && var1.equals("classic")) {
- return super.getClassLoaderCacheKey();
- } else {
- if (this.classLoaderCacheKey == null) {
- StringBuffer var2 = new StringBuffer();
- var2.append(this.getCodeBase());
- String var3 = this.getJarFiles();
- if (var3 != null) {
- var2.append(",");
- var2.append(var3);
- }
-
- this.classLoaderCacheKey = var2.toString();
- }
-
- return this.classLoaderCacheKey;
- }
- }
-
- private static synchronized String getJarsInCacheArchiveEx(String var0) {
- if (var0 == null) {
- return null;
- } else {
- String var1 = "";
- StringTokenizer var2 = new StringTokenizer(var0, ",", false);
- int var3 = var2.countTokens();
-
- for(int var4 = 0; var4 < var3; ++var4) {
- String var5 = var2.nextToken().trim();
- int var6 = var5.indexOf(";");
- if (var6 != -1) {
- String var7 = var5.substring(0, var6);
- var1 = var1 + var7;
- var1 = var1 + (var4 != var3 - 1 ? "," : "");
- }
- }
-
- return var1;
- }
- }
-
- public String getJarFiles() {
- StringBuffer var1 = null;
- if (!this.newStyleJarList.isEmpty()) {
- Iterator var8 = this.newStyleJarList.iterator();
-
- while(var8.hasNext()) {
- if (var1 == null) {
- var1 = new StringBuffer();
- }
-
- String var9 = (String)var8.next();
- var1.append(var9);
- if (var8.hasNext()) {
- var1.append(",");
- }
- }
-
- return this.addJarFileToPath(var1 == null ? null : var1.toString(), (String)null);
- } else {
- String var2 = this.getParameter("archive");
- String var3 = this.getParameter("java_archive");
- String var4 = this.getParameter("cache_archive");
- String var5 = this.getParameter("cache_archive_ex");
- String var6 = null;
- if (var5 != null) {
- int var7 = var5.indexOf(";");
- if (var7 != -1) {
- var6 = getJarsInCacheArchiveEx(var5);
- } else {
- var6 = var5;
- }
- }
-
- return this.addJarFileToPath(var6, this.addJarFileToPath(var4, this.addJarFileToPath(var3, var2)));
- }
- }
-
- private String addJarFileToPath(String var1, String var2) {
- if (var1 == null && var2 == null) {
- return null;
- } else if (var1 == null && var2 != null) {
- return var2;
- } else {
- return var1 != null && var2 == null ? var1 : var1 + "," + var2;
- }
- }
-
- private void loadLocalJarFiles(PluginClassLoader var1, String var2) {
- File var3 = new File(var2);
- if (var3.exists()) {
- String[] var4 = var3.list(new 3(this));
-
- for(int var5 = 0; var5 < var4.length; ++var5) {
- try {
- URL var6 = (new File(var2 + File.separator + var4[var5])).toURI().toURL();
- var1.addLocalJar(var6);
- } catch (MalformedURLException var7) {
- var7.printStackTrace();
- }
- }
- }
-
- }
-
- protected void setupAppletAppContext() {
- this.storeJarVersionMapInAppContext();
- AppContext.getAppContext().put("deploy.trust.decider.app.name", this.getName());
- }
-
- protected void loadJarFiles(AppletClassLoader var1) throws IOException, InterruptedException {
- if (this.loading_first_time) {
- this.loading_first_time = false;
-
- try {
- this.preloading = true;
- JarCacheUtil.preload(this.getCodeBase(), this.preloadJarMap);
- this.preloading = false;
- } catch (Exception var9) {
- Trace.printException(var9, ResourceHandler.getMessage("cache.error.text"), ResourceHandler.getMessage("cache.error.caption"));
- }
- }
-
- String var2 = this.getJarFiles();
-
- try {
- this.cli.lock();
- if (!this.cli.getLocalJarsLoaded() && var1 instanceof PluginClassLoader) {
- String var3 = File.separator;
- String var4 = System.getProperty("java.home") + var3 + "lib" + var3 + "applet";
- this.loadLocalJarFiles((PluginClassLoader)var1, var4);
- if (Config.getOSName().equalsIgnoreCase("Windows")) {
- String var5 = Config.getSystemHome() + var3 + "Lib" + var3 + "Untrusted";
- this.loadLocalJarFiles((PluginClassLoader)var1, var5);
- }
-
- this.cli.setLocalJarsLoaded(true);
- }
-
- if (var2 != null) {
- StringTokenizer var11 = new StringTokenizer(var2, ",", false);
-
- while(var11.hasMoreTokens()) {
- String var12 = var11.nextToken().trim();
- if (!this.cli.hasJar(var12)) {
- this.cli.addJar(var12);
- }
- }
-
- super.loadJarFiles(var1);
- return;
- }
- } finally {
- this.cli.unlock();
- }
-
- }
-
- public String getSerializedObject() {
- String var1 = this.getParameter("java_object");
- if (var1 == null) {
- var1 = this.getParameter("object");
- }
-
- return var1;
- }
-
- public Applet getApplet() {
- Applet var1 = super.getApplet();
- if (var1 != null) {
- return var1 instanceof BeansApplet ? null : var1;
- } else {
- return null;
- }
- }
-
- public Object getViewedObject() {
- Applet var1 = super.getApplet();
- return var1 instanceof BeansApplet ? ((BeansApplet)var1).bean : var1;
- }
-
- public void setAppletContext(AppletContext var1) {
- if (var1 == null) {
- throw new IllegalArgumentException("AppletContext");
- } else {
- if (this.appletContext != null) {
- this.appletContext.removeAppletPanelFromContext(this);
- }
-
- this.appletContext = (PluginAppletContext)var1;
- }
- }
-
- public AppletContext getAppletContext() {
- return this.appletContext;
- }
-
- public void setColorAndText() {
- Object var1 = null;
- String var2 = this.getParameter("boxbgcolor");
- if (var2 != null) {
- Color var6 = this.createColor("boxbgcolor", var2);
- if (var6 != null) {
- this.grayBoxPainter.setBoxBGColor(var6);
- }
- }
-
- this.setBackground(this.grayBoxPainter.getBoxBGColor());
- String var3 = this.getParameter("boxfgcolor");
- if (var3 != null) {
- Color var7 = this.createColor("boxfgcolor", var3);
- if (var7 != null) {
- this.grayBoxPainter.setBoxFGColor(var7);
- }
- }
-
- String var4 = this.getParameter("progresscolor");
- if (var4 != null) {
- Color var8 = this.createColor("progresscolor", var4);
- if (var8 != null) {
- this.grayBoxPainter.setProgressColor(var8);
- }
- }
-
- this.customBoxMessage = this.getParameter("boxmessage");
- if (this.customBoxMessage != null) {
- this.grayBoxPainter.setWaitingMessage(this.customBoxMessage);
- } else {
- this.grayBoxPainter.setWaitingMessage(this.getWaitingMessage());
- }
-
- String var5 = this.getParameter("progressbar");
- if (var5 != null) {
- this.grayBoxPainter.enableProgressBar(new Boolean(var5));
- }
-
- }
-
- private Color createColor(String var1, String var2) {
- if (var2 != null && var2.indexOf(",") != -1) {
- StringTokenizer var3 = new StringTokenizer(var2, ",");
- if (var3.countTokens() == 3) {
- int var4 = 0;
- int var5 = 0;
- int var6 = 0;
-
- int var7;
- for(var7 = 0; var3.hasMoreTokens(); ++var4) {
- String var8 = (String)var3.nextElement();
- switch (var4) {
- case 0:
- if (!var8.trim().equals("")) {
- var5 = new Integer(var8.trim());
- }
- break;
- case 1:
- if (!var8.trim().equals("")) {
- var6 = new Integer(var8.trim());
- }
- break;
- case 2:
- if (!var8.trim().equals("")) {
- var7 = new Integer(var8.trim());
- }
- }
- }
-
- return new Color(var5, var6, var7);
- } else {
- Trace.msgPrintln("applet_viewer.color_tag", new Object[]{var1});
- return null;
- }
- } else {
- if (var2 != null) {
- try {
- return Color.decode(var2);
- } catch (NumberFormatException var9) {
- if (var2.equalsIgnoreCase("red")) {
- return Color.red;
- }
-
- if (var2.equalsIgnoreCase("yellow")) {
- return Color.yellow;
- }
- }
-
- if (var2.equalsIgnoreCase("black")) {
- return Color.black;
- }
-
- if (var2.equalsIgnoreCase("blue")) {
- return Color.blue;
- }
-
- if (var2.equalsIgnoreCase("cyan") || var2.equalsIgnoreCase("aqua")) {
- return Color.cyan;
- }
-
- if (var2.equalsIgnoreCase("darkGray")) {
- return Color.darkGray;
- }
-
- if (var2.equalsIgnoreCase("gray")) {
- return Color.gray;
- }
-
- if (var2.equalsIgnoreCase("lightGray") || var2.equalsIgnoreCase("silver")) {
- return Color.lightGray;
- }
-
- if (var2.equalsIgnoreCase("green") || var2.equalsIgnoreCase("lime")) {
- return Color.green;
- }
-
- if (var2.equalsIgnoreCase("magenta") || var2.equalsIgnoreCase("fuchsia")) {
- return Color.magenta;
- }
-
- if (var2.equalsIgnoreCase("orange")) {
- return Color.orange;
- }
-
- if (var2.equalsIgnoreCase("pink")) {
- return Color.pink;
- }
-
- if (var2.equalsIgnoreCase("white")) {
- return Color.white;
- }
-
- if (var2.equalsIgnoreCase("maroon")) {
- return new Color(128, 0, 0);
- }
-
- if (var2.equalsIgnoreCase("purple")) {
- return new Color(128, 0, 128);
- }
-
- if (var2.equalsIgnoreCase("navy")) {
- return new Color(0, 0, 128);
- }
-
- if (var2.equalsIgnoreCase("teal")) {
- return new Color(0, 128, 128);
- }
-
- if (var2.equalsIgnoreCase("olive")) {
- return new Color(128, 128, 0);
- }
- }
-
- return null;
- }
- }
-
- public void paint(Graphics var1) {
- Dimension var2 = this.getSize();
- if (var2.width <= 0 || var2.height <= 0 || this.status != 1 && this.status != 2 && this.status != 7) {
- super.paint(var1);
- } else {
- this.paintForegrnd(var1);
- }
-
- }
-
- public Color getForeground() {
- Color var1 = super.getForeground();
- if (null == var1) {
- var1 = Color.BLACK;
- }
-
- return var1;
- }
-
- public void paintForegrnd(Graphics var1) {
- if (this.grayBoxPainter != null) {
- this.grayBoxPainter.paintGrayBox(this, var1);
- }
-
- }
-
- public String getWaitingMessage() {
- if (this.status == 7) {
- return getMessage("failed");
- } else {
- MessageFormat var1 = new MessageFormat(getMessage("loading"));
- return var1.format(new Object[]{this.getHandledType()});
- }
- }
-
- protected void load(InputStream var1) {
- this.field_0 = var1;
- }
-
- protected Applet createApplet(AppletClassLoader var1) throws ClassNotFoundException, IllegalAccessException, IOException, InstantiationException, InterruptedException {
- if (this.field_0 == null) {
- return super.createApplet(var1);
- } else {
- AppletObjectInputStream var2 = new AppletObjectInputStream(this.field_0, var1);
- Object var3 = ((ObjectInputStream)var2).readObject();
- Applet var4 = (Applet)var3;
- this.doInit = false;
- if (Thread.interrupted()) {
- try {
- this.status = 0;
- Object var8 = null;
- this.showAppletStatus("death");
- } finally {
- Thread.currentThread().interrupt();
- }
-
- return null;
- } else {
- this.field_0 = null;
- return var4;
- }
- }
- }
-
- public String getName() {
- String var1 = this.getParameter("name");
- if (var1 != null) {
- return var1;
- } else {
- var1 = this.getCode();
- if (var1 != null) {
- int var2 = var1.lastIndexOf(".class");
- if (var2 != -1) {
- var1 = var1.substring(0, var2);
- }
- } else {
- var1 = this.getSerializedObject();
- if (var1 != null) {
- int var4 = var1.lastIndexOf(".ser");
- if (var4 != -1) {
- var1 = var1.substring(0, var4);
- }
- }
- }
-
- return var1;
- }
- }
-
- public static int getAcceleratorKey(String var0) {
- return ResourceHandler.getAcceleratorKey(var0);
- }
-
- protected String getHandledType() {
- return getMessage("java_applet");
- }
-
- public void addAppletStatusListener(AppletStatusListener var1) {
- this.statusListener = var1;
- }
-
- public void removeAppletStatusListener(AppletStatusListener var1) {
- this.statusListener = null;
- }
-
- public void setStatus(int var1) {
- this.status = var1;
- }
-
- public void showAppletLog(String var1) {
- super.showAppletLog(var1);
- }
-
- public boolean isStopped() {
- return this.stopped;
- }
-
- public void showAppletStatus(String var1) {
- if (var1 != null && !var1.equals("") && !var1.equals("\n")) {
- String var2 = this.getName();
- MessageFormat var3 = new MessageFormat(getMessage("status_applet"));
- if (var2 != null && !var1.equals("")) {
- this.getAppletContext().showStatus(var3.format(new Object[]{var2, var1}));
- } else {
- this.getAppletContext().showStatus(var3.format(new Object[]{var1, ""}));
- }
-
- if (this.grayBoxPainter != null) {
- if (this.status == 7) {
- this.grayBoxPainter.showLoadingError();
- } else if (this.status >= 3) {
- this.grayBoxPainter.suspendPainting();
- }
- }
-
- if (this.statusListener != null) {
- this.statusListener.statusChanged(this.status);
- }
- }
-
- }
-
- public void setDoInit(boolean var1) {
- this.doInit = var1;
- }
-
- public static String getMessage(String var0) {
- return ResourceHandler.getMessage(var0);
- }
-
- public static String[] getMessageArray(String var0) {
- return ResourceHandler.getMessageArray(var0);
- }
-
- protected AppletClassLoader createClassLoader(URL var1) {
- return ClassLoaderInfo.find(var1, this.getClassLoaderCacheKey()).getLoader();
- }
-
- protected void showAppletException(Throwable var1) {
- super.showAppletException(var1);
- Trace.msgPrintln("exception", new Object[]{var1.toString()});
- if (fShowException) {
- Trace.printException(var1);
- }
-
- if (this.grayBoxPainter != null) {
- this.grayBoxPainter.showLoadingError();
- }
-
- }
-
- public void showStatusText(String var1) {
- this.getAppletContext().showStatus(var1);
- }
-
- public void update(Graphics var1) {
- Dimension var2 = this.getSize();
- if (var2.width <= 0 || var2.height <= 0 || this.status != 1 && this.status != 2 && this.status != 7) {
- super.update(var1);
- } else {
- this.paintForegrnd(var1);
- }
-
- }
-
- public int getLoadingStatus() {
- return this.status;
- }
-
- public void windowActivated(WindowEvent var1) {
- }
-
- public void windowClosed(WindowEvent var1) {
- }
-
- public void windowClosing(WindowEvent var1) {
- }
-
- public void windowDeactivated(WindowEvent var1) {
- }
-
- public void windowDeiconified(WindowEvent var1) {
- }
-
- public void windowIconified(WindowEvent var1) {
- }
-
- public void windowOpened(WindowEvent var1) {
- }
- }
-